﻿Imports System.Data.SqlClient

Module Clients_Utilities

    Public Function GetClientName(ByVal ClientID As Integer) As String
        Try
            Dim cmd As New SqlCommand("Select IsNull(FullName,N'') From Clients Where SNo=" & ClientID, cnn)
            Dim ClientName As String

            cnn.Open()
            ClientName = CStr(cmd.ExecuteScalar)
            cnn.Close()

            Return ClientName
        Catch ex As Exception
            If cnn.State = ConnectionState.Open Then
                cnn.Close()
            End If
            MsgBox(ex.ToString)
        End Try
    End Function
End Module
